import React from 'react';
import { Descriptions, Modal } from 'antd';
import { NotifyFlowInfo } from 'admin/schema/NotifyFlows';

interface Iprops {
  visible: boolean; // 窗口显示隐藏
  formData: NotifyFlowInfo; // 外部数据
  onClose: () => void; // 对话框关闭时的回调
}
/**通知详情*/
const NotifyFlowDetail: React.FC<Iprops> = ({ visible, formData, onClose }) => {
  return (
    <Modal
      className="notice-flow-detail"
      width={600}
      title="通知流程详情"
      visible={visible}
      footer={null}
      destroyOnClose={true}
      onCancel={onClose}
    >
      <Descriptions title={null} column={1}>
        <Descriptions.Item label="流程名称">{formData.flowName}</Descriptions.Item>
        <Descriptions.Item label="话术">{formData.flowScript}</Descriptions.Item>
        {formData.beforeCallSmsTempName && (
          <Descriptions.Item label="呼前短信">{formData.beforeCallSmsTempName}</Descriptions.Item>
        )}
        {formData.sysAnswerByeTempName && (
          <Descriptions.Item label="呼通挂机短信">
            {formData.sysAnswerByeTempName}
          </Descriptions.Item>
        )}
        {formData.sysNoanswerByeTempName && (
          <Descriptions.Item label="未呼通挂机短信">
            {formData.sysNoanswerByeTempName}
          </Descriptions.Item>
        )}
      </Descriptions>
    </Modal>
  );
};

export default NotifyFlowDetail;
